package com.hei.service;

import com.hei.dao.BcommentMapper;
import com.hei.pojo.Bcomment;
import com.hei.pojo.BcommentExample;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BcommentServiceImpl implements  BcommentService{
    @Autowired
    private BcommentMapper bcommentMapper;

    public int selectCountById(String id) {

        return bcommentMapper.selectCountById(id);
    }

    public List<Bcomment> selectById(String id) {
        BcommentExample example=new BcommentExample();
        example.createCriteria().andAIdEqualTo(id);
        return bcommentMapper.selectByExample(example);
    }

    public void addComment(Bcomment bcomment) {
        bcommentMapper.insert(bcomment);
    }

    @Override
    public int queryAllCount() {
        return bcommentMapper.quertCount();
    }
}
